package com.caizi.remote.rmi;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;

public class ShowBindings {
    public static void main(String[] args) {
        try {
            Context namingContext = new InitialContext();
            NamingEnumeration<NameClassPair> e = namingContext.list("rmi:");
            while (e.hasMore()) {
                System.out.println(e.next().getName());
            }
        } catch (NamingException e1) {
            e1.printStackTrace();
        }
    }
}
